home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / lists / gem / l_1199 / 1162 < prev    next >
Encoding:
Internet Message Format  |  1994-08-27  |  14.1 KB

  1. Date: Sat, 30 Jul 1994 16:52:42 -0400 (EDT)
  2. From: Timothy Miller <millert@cs.csee.usf.edu>
  3. Subject: Re: Digest
  4. To: gem-list@world.std.com
  5. In-Reply-To: <2e38ffb6fbd12@elfhaven.ersys.edmonton.ab.ca>
  6. Message-Id: <Pine.3.87.9407301642.A26054-0100000@grad>
  7. Mime-Version: 1.0
  8. Precedence: bulk
  9.  
  10. Evan:
  11.  
  12. ]Its a bug in the AES.  I get it too.  Sometimes, I just get clicks with
  13. ]background windows instead of a top.  I get it in TOSWIN alot, which is
  14. ]when I have lots of windows open, so that could be part of it.  I just
  15. ]jam the mouse into the menu bar and then click (since I usually have
  16. ]window everywhere, and the menu bar is the only place uncovered!)
  17.  
  18. If my guess is correct, then it is not a bug in AES.  Rather, 
  19. graf_dragbox and form_button use evnt_multi!  And since evnt_multi 
  20. obviously will not send repeated WM_TOPPED messages to the same window 
  21. while the mouse is held down, then graf_dragbox and form_button will not 
  22. work.  graf_mkstate, on the other hand, works just great.
  23.  
  24. ]Your solution .. you said you were simulating mouse events.  How did
  25. ]you do this.  I wanna see how much it changes the code I posted previously.
  26. ]Since the code I posted allowed some pretty radical behavior (the use
  27. ]of the other mouse buttons during a drag!) and I don't want to lose
  28. ]that flexibility.  In fact, I don't want to call any graf_ functions
  29. ]or anything else that creates a mode.  I want to flow everything though
  30. ]evnt_multi() with an optimized binding (no stack usage, etc) and doll
  31. ]out the events to other objects from there.
  32.  
  33. My solution was to write my own form_button which does nothing 
  34. spectacular.  It just does everything that the normal form_button (took 
  35. me a lot of guess work, but I can't tell any difference between mine and 
  36. the normal one), except that mine will work even if the object is 
  37. partially obscured.
  38.  
  39. Writing my own form_button solved the problem of it locking up.  The 
  40. second problem was to get repeated mouse events to a background window.  
  41. Since evnt_multi win't sent repeated WM_TOPPED messages, I have to handle 
  42. everything after I get the first one, *plus I have to make sure the mouse 
  43. button it up before the next evnt_multi call*.
  44.  
  45. I have one routine that handles WM_TOPPED events, and another that 
  46. handles MU_BUTTON events.  When I get a WM_TOPPED message for a 
  47. background window that is 'backactive', I get the current mouse position 
  48. and other information and send it to my routine that handles the 
  49. MU_BUTTON events, thereby simulating a button event on the background window.
  50.  
  51. To do drags and to make sure that the button is up before the next 
  52. evnt_multi (when my WM_TOPPED handling routine returns to the caller), I 
  53. have a loop in my WM_TOPPED handler that keeps getting mouse positions 
  54. and information as long as the button is held down.  As soon as the 
  55. button is let up, it returns to the calling routine.
  56.  
  57. This works great.  The only problem is that while the button is down, the 
  58. operations of my library are trapped within itself, not getting back to 
  59. evnt_multi.  But since you can't use evnt_multi anyway, there's no point 
  60. in arguing about it.  However, since my library doesn't use wind_update 
  61. (since it's not using VDI, it doesn't need to, plus a developer is 
  62. responsible for doing it for his own window drawing, PLUS since you're 
  63. dragging around in a window, you couldn't move the mouse pointer to the 
  64. menu bar to fowl anything up), no activities in other windows would be 
  65. bothered with much.
  66.  
  67.  
  68. ]========================================================================
  69. ]Well, I break my library down into a few seperate .C files and the
  70. ]programmer can pick which ones he wants.  I'm sure that's what most of 
  71. us do.
  72. ]========================================================================
  73. ]
  74. ]Nope, you put EVERY function in a separate C file, roll the whole thing
  75. ]into a .a or .lib or what have you, and then whatever functions the
  76. ]programmer uses will be included by the linker.  The linker includes
  77. ]entire .o files, so the programmer doesn't choose, the LINKER chooses.
  78. ]This requires libraries to have TONS of files.  Makes a MINIX filesystem
  79. ]very handy, but that is beside the point.
  80.  
  81. Sounds icky, but I'll see what I can do.  I think, though, I will cut it 
  82. up after I'm done.
  83.  
  84. But there is one thing I need to mention... some of my functions use 
  85. other functions that only THEY use and are not needed to be accessed from 
  86. any where else.  Should I put them into the same O file?
  87.  
  88. How do I create an A or LIB file?  What is the difference between the 
  89. two?  I've never looked into this before.
  90.  
  91.  
  92.  
  93. About app-defs:
  94.  
  95. AVOID scancodes it the app-defs file.  It's easy enough to tell the 
  96. difference between Backspace and Ctrl-H (or Return/Enter/Ctrl-M, etc...) 
  97. regardless of where H is because while H may move, Backspace won't and 
  98. Ctrl-H is then just any key that produces an ascii code of 7 what ISN'T 
  99. the Backspace key.  It's quite simple.  Therefore, only specify ASCII 
  100. codes in the app-defs file for the letter keys.  Anything else like 
  101. Return, Enter, Backspace should, however, be referenced by scancode.  
  102. Plus, it's safe to do that because THEY don't move.
  103.  
  104.  
  105. Oh, and there's another problem with app-defs... if you don't have a TSR 
  106. to load it (of course translate it into something useful) and put it in 
  107. one place in memory, then you'll have every app with its own copy of the 
  108. file.  On the other hand, the TSR creates a load of its own problems, not 
  109. the least of which is the fact that the app is going to have to figure 
  110. out whether it should use the default key or determine if the user's put 
  111. one in there to customise it just for that app.
  112.  
  113.  
  114. ]Huh?   No, no, no.  Like this:
  115. ]
  116. ]*.*.autoSave.yes
  117. ]*.*.confirmAtExit.yes
  118. ]*.YourApp.autoSave.no
  119. ]*.TosWin.autoSave.no
  120. ]
  121. ]Get it?  Now everything but YourApp and TosWin will autosave.  Everything
  122. ]confirms at exit.  You can still manually save.  You don't have to change
  123. ]anything.  In fact, the file is pretty static.  You only need to change
  124. ]it to change global settings or to change a specific application to do
  125. ]something different than the global settings you've installed.  You edit
  126. ]less because if you turn off a global feature, that program you haven't
  127. ]used in 3 months doesn't have to be reconfigured!
  128.  
  129. I don't like this particular example.  There are some things that you 
  130. MIGHT want to configure in a global file, but auto-save isn't one of 
  131. them.  IF an app has auto-save, I would think that it should keep track 
  132. of it in its OWN config file.
  133.  
  134.  
  135. Everyone seems to be bent on making the app-defs file an ASCII file.  
  136. While I can see the clear benefits (user editable with an ASCII text 
  137. editor, etc.), I can see some clear draw-backs.  If it's an ASCII file, 
  138. any utility manipulating it will have to delete it and write a new one 
  139. any time a change is made because the size of the file would change 
  140. (although this isn't much of a big deal), plus it's harder to parce 
  141. (because if it's binary data, you don't have to parce at all!).
  142.  
  143.  
  144. Evan:
  145.  
  146. ]Thread2 - this waits on any number of file handles, although it only
  147. ]needs to wait on one (optional timeout).  It blocks until the
  148. ]device is has data ready to be read or written.  When Fselect returns,
  149. ]Fread as much data from the file handle (raw mode) as you can,
  150. ]with standard GEMDOS Fread() with a whatever maximum you like (you
  151. ]can use whatever you like, or dynamically change the size if Fread
  152. ]reads your entire buffer, then double the size so it doesn't fill
  153. ]up anymore!)  After you read all the data, update your windows
  154. ]internal and external structures.  Key events are still echoed
  155. ]directly to the modem, even during redraw.  Once you've done the
  156. ]update, call Fselect again and wait for more modem data.  This thread
  157. ]will block when there is no modem IO to read.
  158.  
  159. This sounds very interesting.  I'll have to figure out Fselect.
  160. One problem I have with modem I/O is that GEMDOS does not seem to provide 
  161. a way for me determine how many characters are there before using Fread.  
  162. As a result, I have to use Fread (or Bconin) repeatedly, reading one 
  163. character until Bconstat says there are no more characters.
  164.  
  165. I have a couple or routines that read directly from the Iorec structure 
  166. and read the buffer directly.  It works VERY fast.  Would this interfere 
  167. with MultiTOS?
  168.  
  169. How do I find out how many characters are there that I can read?
  170.  
  171. What is the file handle of the serial port?
  172.  
  173. Evan, you mention Fread having a raw-mode?  GEMDOS does not translate and 
  174. strip off cr's from cr/lf's.  And it does not wait for an EOL before 
  175. returning to the program.  It reads as many bytes as you tell it and then 
  176. returns.
  177.  
  178. If I Fread x bytes from the serial port, does it wait until it gets x 
  179. bytes or does it return after it reads as many as it can?
  180.  
  181.  
  182. For local echo, I would have both the main program and the threaded I/O 
  183. routine call the same function to deal with putting characters on the 
  184. screen.  I just have to be careful that they don't clash... I'd have the 
  185. main program wait until the thread was done.
  186.  
  187.  
  188. Some day, I MAY get back to writing ANSI Link.  :)  But first I'll have 
  189. to finish my library and then rewrite ANSI Link to use the library.
  190.  
  191.  
  192. ]========================================================================
  193. ]My library can now do dragging of active and passive sliders in
  194. ]background windows, as well as buttons.  It also handles all of these
  195. ]things using the rectangles list so they come out properly if partially
  196. ]obscured.
  197. ]========================================================================
  198. ]
  199. ]Hmm .. how?  You don't get any events until you release the button!
  200. ]What sort of hackery is this?   Could you post the code?  Or email
  201. ]it to evanlang@uss.lonestar.org?
  202.  
  203. I have posted descriptions of this before and in this message.  If 
  204. they're not clear, please ask questions.
  205.  
  206.  
  207. ]========================================================================
  208. ]You have an Atari book that needs to be published?  Two Worlds Publishing
  209. ]can do it for you.  :)
  210. ]========================================================================
  211. ]
  212. ]The internet frowns on commercial advertising .. can you have a
  213. ]shareware publishing company?
  214.  
  215. Where?  When?  I see commercial developers mentioning product releases in 
  216. public and on announce groups all the time.  PLUS, this is email, so I 
  217. can say just about anything I want (within reason because it is KINDA 
  218. public being on a mailing list).
  219.  
  220. Or are you just pulling my leg here?
  221.  
  222.  
  223. Ofir:
  224.  
  225. ]We must be a bunch of extremely lucky people who have not been oplagued by
  226. ]this problem. There was a 97% majority against you last time I looked. And
  227. ]I don't think it's surprising. In fact, if there was a majority otherwise
  228. ]I would have unsubscribed as such a result would go totalloy against the
  229. ]idea of this mail list.
  230.  
  231. Would you have unsubscribed indeed?  How childish of you.  Yet you bashed 
  232. me for suggesting that I might unsubscribe because of the exact opposite.
  233.  
  234. You seem to have the attitude that what you say is correct and what I say 
  235. is NOT, simply because you disagree with me.
  236.  
  237. I have a good reason with physical evidence against using Ctrl-A for 
  238. Select All.  We've been over this countless times.  You, on the other 
  239. hand, have no PHYSICAL support... you cop out and claim that you want to 
  240. keep it just because 'people have used it before'.  All through history, 
  241. people have done all sorts of stupid things just because 'lots of other 
  242. people did it too'.  This doesn't make it right.
  243.  
  244. Would it have gone against the idea of the mailing list?  Perhaps... if 
  245. the idea of this mailing list is to blindly make standards, regardless of 
  246. any danger they might they might cause.
  247.  
  248. On the other hand, if the idea of this list is to make GOOD standards, 
  249. then my suggestion is certainly the more logical.
  250.  
  251. You seem to believe that common use has priority over saftey.  This is wrong.
  252.  
  253. Saftey comes first, then useability, THEN common use.
  254.  
  255. As we all well know, humans can do some pretty stupid things (wars, 
  256. crimes, flat-earth society, prejudice, slavery, the US congress, etc.), 
  257. yet the fact that a few people or a majority do something doesn't make it 
  258. right.
  259.  
  260. Some people use Ctrl-A for Select All.  Mostly on other machines where 
  261. Ctrl is NOT next to A.  Nay, let's say a majority use Ctrl-A for Select 
  262. All (most of whom are using other keyboards where Ctrl is not next to 
  263. A).  This doesn't make it right for an Atari keyboard where Ctrl IS next 
  264. to A.
  265.  
  266. On the A, one places their little finger, a weak finger that does not 
  267. quite have the dexterity of the others.  This finger can easily slip JUST 
  268. A LITTLE to the left, and since there is practically no inter-key spacing 
  269. on the Atari keyboard, this little finger will then hit the Ctrl key as 
  270. well as the A key.
  271.  
  272. It is QUITE CLEAR how easy it is to accidentally hit Ctrl-A, yet you wish 
  273. to assign something as dangerous as Select-All to it?
  274.  
  275. Think clearly about the physics of the human hands, the fact that most 
  276. people are not experienced typists, and the shape of the Atari keyboard.  
  277. You developers have been typing for decades, and while you may be 
  278. self-taught (as am I), you are much better typists than the average 
  279. person using the keyboard.  This average person will have a tremendously 
  280. higher chance of slipping and hitting Ctrl-A then you would.  You are not 
  281. plagued by this problem, but THEY ARE!
  282.  
  283. Empathise with the user.  Pretend you have weak, untrained fingers and 
  284. THEN type.  Think not about what works well for you as a programmer, but 
  285. what works well for the average users.  Now, one of the things I like 
  286. about Atari programs is that they are written with interfaces that the 
  287. programmer likes, and I, being a programmer, like them as well.  However, 
  288. you should not forget about the average user.
  289.  
  290. Whatever the direction of your user interface, though, you should avoid 
  291. doing anything stupid.
  292.  
  293.  
  294.  
  295. ]I speak to hundreds of users through the Atari ST Review helpline - none of
  296. ]them uses MiNT, most do not even know what it is. A complex app-defs file
  297. ]like you are suggesting is a recipe for dissaster for these users.
  298.  
  299. Bravo!  Quite true!  Again, we need to Keep It Simple, Stupid.
  300.  
  301. Anything that corresponds to something very application-specific should 
  302. be kept in the app's own config file.  Auto-save, whatever.
  303.  
  304. And again, I don't even very much like the idea of maintianing keys in a 
  305. global file anyway.
  306.  
  307.  
  308.  
  309. ---------------
  310. Ani rotse harbeh kesef.
  311. Ich moechte vill geld.
  312. Don't we all?
  313.  
  314.  
  315.